<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>立体按钮</title>
    <style>
      * {
        padding: 0;
        margin: 0;
      }

      body {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        background-color: #f1f1f1;
      }
      button {
        font-family: Helvetica, sans-serif;
        border: 0;
        background-color: white;
        width: 100px;
        height: 100px;
        border-radius: 20px;
        /* 关键是只用这个 盒子阴影 的样式 */
        box-shadow: -6px 6px 8px inset rgba(255, 255, 255, 0.6),
          6px -6px 8px inset rgba(0, 0, 0, 0.2);
      }

      button:active {
        box-shadow: -6px 6px 8px inset rgba(0, 0, 0, 0.2),
          6px -6px 8px inset rgba(255, 255, 255, 0.6);
      }
    </style>
  </head>
  <body>
    <button>Btn</button>
  </body>
</html>
